const namespace = 'tester';

export const storage = {
  set(key: string, value: unknown) {
    localStorage.setItem(`${namespace}-${key}`, JSON.stringify(value));
  },

  get(key: string) {
    const dataStr = localStorage.getItem(`${namespace}-${key}`);
    if (!dataStr) return null;

    const data = JSON.parse(dataStr);
    return data;
  },

  remove(key: string) {
    localStorage.removeItem(`${namespace}-${key}`);
  },
};
